﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;

namespace Sparrow.Reflection
{
    public static class MetadataCache
    {
        static MetadataCache()
        {
            Metadatas = new ConcurrentDictionary<Type, Metadata>();
        }
        public static ConcurrentDictionary<Type, Metadata> Metadatas
        {
            get;
            private set;
        }

        public static Metadata Create(object obj)
        {
            var type = obj.GetType();
            return Metadatas.GetOrAdd(type, i => new Metadata(i));
        }


    }
}
